jQuery(document).ready(function() {
	initLoader();
});
 
function initLoader() {
  var script = document.createElement("script");
  script.src = "https://www.google.com/jsapi?callback=loadChartAPI";
  script.type = "text/javascript";
  document.getElementsByTagName("head")[0].appendChild(script);	
} 

function loadChartAPI() {
	google.load("visualization", "1", {packages:["corechart"], "callback": drawChart});
}

function drawChart() {
    var data = google.visualization.arrayToDataTable([
      ['Datum', 'Ideal Burndown', 'Actual Burndown'],
      ['5.3.2012', 100, 80],
      ['6.3.2012', 80, 75],
      ['8.3.2012', 40, 56],
      ['10.3.2012', 5, 10],
      ['12.3.2012', 0, 2]
    ]);

    var options = {
      title: 'Sprint Burdown Chart',
      hAxis: {title: 'Datum',  titleTextStyle: {color: 'blue'}},
      vAxis: {title: 'Stunden',  titleTextStyle: {color: 'black'}},
	  height: 300,
	  width: 830
    };

    var chart = new google.visualization.LineChart(document.getElementById('sprintChartBurndown'));
    chart.draw(data, options);
}
